package com.warm.base.design.s_decorator;

/**
 * @Date: 2019/11/22 10:30
 * @Author: LChuang
 * @Description:
 */
public class Decorator extends Component {

    /**
     * 被装饰对象
     */
    private Component component;

    /**
     * 构造函数传递要装饰的对象
     */
    public Decorator(Component component){
        this.component = component;
    }

    @Override
    public void operate() {
        //调用被装饰者方法
        this.component.operate();
    }
}
